createAdapter
Creates a new network adapter.
/subnet/{subnetId}/adapter
Usage and SDK Samples
curl -X POST \
-H "X-API-Key: [[apiKey]]" \
-H "Authorization: Bearer [[accessToken]]" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"/api/v1/subnet/{subnetId}/adapter?assignIP=true" \
-d '{
"addresses" : [ "addresses", "addresses" ],
"reserved" : false,
"name" : "name",
"description" : "description",
"id" : "id",
"mac" : "mac"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdapterApi;
import java.io.File;
import java.util.*;
public class AdapterApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
// Configure Bearer (JWT) access token for authorization: BearerAuth
HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth");
BearerAuth.setBearerToken("BEARER TOKEN");
// Create an instance of the API class
AdapterApi apiInstance = new AdapterApi();
String subnetId = subnetId_example; // String | The ID of the network subnet.
Adapter adapter = ; // Adapter |
Boolean assignIP = true; // Boolean | Whether Kowabunga should pick and assign an IP address to this adapter.
try {
Adapter result = apiInstance.createAdapter(subnetId, adapter, assignIP);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdapterApi#createAdapter");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final String subnetId = new String(); // String | The ID of the network subnet.
final Adapter adapter = new Adapter(); // Adapter |
final Boolean assignIP = new Boolean(); // Boolean | Whether Kowabunga should pick and assign an IP address to this adapter.
try {
final result = await api_instance.createAdapter(subnetId, adapter, assignIP);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->createAdapter: $e\n');
}
import org.openapitools.client.api.AdapterApi;
public class AdapterApiExample {
public static void main(String[] args) {
AdapterApi apiInstance = new AdapterApi();
String subnetId = subnetId_example; // String | The ID of the network subnet.
Adapter adapter = ; // Adapter |
Boolean assignIP = true; // Boolean | Whether Kowabunga should pick and assign an IP address to this adapter.
try {
Adapter result = apiInstance.createAdapter(subnetId, adapter, assignIP);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdapterApi#createAdapter");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: ApiKeyAuth)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-API-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-API-Key"];
// Configure Bearer (JWT) access token for authorization: BearerAuth
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Create an instance of the API class
AdapterApi *apiInstance = [[AdapterApi alloc] init];
String *subnetId = subnetId_example; // The ID of the network subnet. (default to null)
Adapter *adapter = ; //
Boolean *assignIP = true; // Whether Kowabunga should pick and assign an IP address to this adapter. (optional) (default to null)
[apiInstance createAdapterWith:subnetId
adapter:adapter
assignIP:assignIP
completionHandler: ^(Adapter output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var KowabungaApiDocumentation = require('kowabunga_api_documentation');
var defaultClient = KowabungaApiDocumentation.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['X-API-Key'] = "Token";
// Configure Bearer (JWT) access token for authorization: BearerAuth
var BearerAuth = defaultClient.authentications['BearerAuth'];
BearerAuth.accessToken = "YOUR ACCESS TOKEN";
// Create an instance of the API class
var api = new KowabungaApiDocumentation.AdapterApi()
var subnetId = subnetId_example; // {String} The ID of the network subnet.
var adapter = ; // {Adapter}
var opts = {
'assignIP': true // {Boolean} Whether Kowabunga should pick and assign an IP address to this adapter.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createAdapter(subnetId, adapter, opts, callback);
using System;
using System.Diagnostics;
using kowabunga.Api;
using kowabunga.Client;
using kowabunga.Model;
namespace Example
{
public class createAdapterExample
{
public void main()
{
// Configure API key authorization: ApiKeyAuth
Configuration.Default.ApiKey.Add("X-API-Key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("X-API-Key", "Bearer");
// Configure Bearer (JWT) access token for authorization: BearerAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Create an instance of the API class
var apiInstance = new AdapterApi();
var subnetId = subnetId_example; // String | The ID of the network subnet. (default to null)
var adapter = new Adapter(); // Adapter |
var assignIP = true; // Boolean | Whether Kowabunga should pick and assign an IP address to this adapter. (optional) (default to null)
try {
Adapter result = apiInstance.createAdapter(subnetId, adapter, assignIP);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling AdapterApi.createAdapter: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
// Configure Bearer (JWT) access token for authorization: BearerAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdapterApi();
$subnetId = subnetId_example; // String | The ID of the network subnet.
$adapter = ; // Adapter |
$assignIP = true; // Boolean | Whether Kowabunga should pick and assign an IP address to this adapter.
try {
$result = $api_instance->createAdapter($subnetId, $adapter, $assignIP);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AdapterApi->createAdapter: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdapterApi;
# Configure API key authorization: ApiKeyAuth
$WWW::OPenAPIClient::Configuration::api_key->{'X-API-Key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'X-API-Key'} = "Bearer";
# Configure Bearer (JWT) access token for authorization: BearerAuth
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdapterApi->new();
my $subnetId = subnetId_example; # String | The ID of the network subnet.
my $adapter = WWW::OPenAPIClient::Object::Adapter->new(); # Adapter |
my $assignIP = true; # Boolean | Whether Kowabunga should pick and assign an IP address to this adapter.
eval {
my $result = $api_instance->createAdapter(subnetId => $subnetId, adapter => $adapter, assignIP => $assignIP);
print Dumper($result);
};
if ($@) {
warn "Exception when calling AdapterApi->createAdapter: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: ApiKeyAuth
openapi_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# Configure Bearer (JWT) access token for authorization: BearerAuth
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Create an instance of the API class
api_instance = openapi_client.AdapterApi()
subnetId = subnetId_example # String | The ID of the network subnet. (default to null)
adapter = # Adapter |
assignIP = true # Boolean | Whether Kowabunga should pick and assign an IP address to this adapter. (optional) (default to null)
try:
api_response = api_instance.create_adapter(subnetId, adapter, assignIP=assignIP)
pprint(api_response)
except ApiException as e:
print("Exception when calling AdapterApi->createAdapter: %s\n" % e)
extern crate AdapterApi;
pub fn main() {
let subnetId = subnetId_example; // String
let adapter = ; // Adapter
let assignIP = true; // Boolean
let mut context = AdapterApi::Context::default();
let result = client.createAdapter(subnetId, adapter, assignIP, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
| Name | Description |
|---|---|
| subnetId* |
String
The ID of the network subnet.
Required
|
| Name | Description |
|---|---|
| adapter * |
Adapter payload. |
| Name | Description |
|---|---|
| assignIP |
Boolean
Whether Kowabunga should pick and assign an IP address to this adapter.
|